# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-tinycss2
pkgver=1.4.0
pkgrel=0
pkgdesc="Low-level CSS parser for Python"
url="https://pypi.org/project/tinycss2"
arch="noarch"
license="BSD-3-Clause"
depends="py3-webencodings"
checkdepends="py3-pytest"
makedepends="py3-gpep517 py3-flit-core"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/t/tinycss2/tinycss2-$pkgver.tar.gz"
builddir="$srcdir/tinycss2-$pkgver"
replaces="py-tinycss py2-tinycss py3-tinycss"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
be0faac6fc55113c4a110d6cd23714867f3f4c33829cadcc8619b1c7b801bc009501cd0f0f7b3d21040129526633ef1f956ef6cb2ca8955d32f2b0b11f875d92  tinycss2-1.4.0.tar.gz
"
